package com.atguigu.admin.controller;

import com.atguigu.admin.service.UserService;
import com.atguigu.param.CartListParam;
import com.atguigu.param.PageParam;
import com.atguigu.pojo.User;
import com.atguigu.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jws.soap.SOAPBinding;

/**
 * ClassName:UserController
 * Package:com.atguigu.admin.controller
 * Description:
 *
 * @Author 应永豪
 * @Create 2024/4/23 11:14
 * @Version 1.0
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("list")
    public R userList(PageParam param) {
        return userService.userList(param);
    }
    @PostMapping("remove")
    public R userRemove(CartListParam param) {
        return userService.userRemove(param);
    }

    @PostMapping("update")
    public R userUpdate(User user) {
        return userService.userUpdate(user);
    }

    @PostMapping("save")
    public R userSave(User user) {
        return userService.userSave(user);
    }

}
